package com.example.demospring5.primary.lifecircle;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.stereotype.Component;

/**
 * <bean id="exampleInitBean" class="examples.ExampleBean" destroy-method="cleanup"/>
 */
@Component
public class LifecycleDestroyBean implements DisposableBean {

    @Override
    public void destroy() {
        // do some destruction work (like releasing pooled connections)
        System.out.println("do some destruction work (like releasing pooled connections");
    }
}